﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ActionSystem.Core;
using XMLib;
using System;

namespace ActionSystem.Core
{
    [System.Serializable]
    public class StateItem
    {
        [CustomLabel("组类型")]
        [SerializeField]
        int gid = StateGroup.NoGroup;
        public int GID
        {
            get => gid;
            set
            {
                gid = value;
            }
        }

        [BaseStateTypes]
        [SerializeReference]//可以使Value设置为根据继承该类型的子类
        public BaseState state=null;
        
        public override string ToString() => (state as BaseState).StateName;
        

    }
    public class BaseStateTypesAttribute : ObjectTypesAttribute
    {
        public override Type baseType => typeof(BaseState);
    }
}


